gnome3.gdm: Always reset the environment for new sessions#48517
Merged
jtojnar merged 1 commit intoNixOS:masterfrom Oct 19, 2018
Merged
gnome3.gdm: Always reset the environment for new sessions#48517jtojnar merged 1 commit intoNixOS:masterfrom
jtojnar merged 1 commit intoNixOS:masterfrom
Conversation
When GDM launches a new session it will inherit the user's systemd environment (but only unset variables). If `__NIXOS_SET_ENVIRONMENT_DONE` is set in the user's systemd environment it will prevent the environment to be set properly or updated (eg. after having done a system rebuild). Gnome sessions exports their environment to systemd at startup. If something is keeping the user's systemd process alive (eg. ssh) launching a new gnome session after logging out will result in a broken PATH. Specifically the PATH will be inherited from GDM and never reset. We patch GDM to never inherit `__NIXOS_SET_ENVIRONMENT_DONE` so new sessions will always reset their base environment. fixes NixOS#48255 For more info about the environment setup: NixOS#45784
Member
|
Looks very hacky, but I guess it's the lesser of several possible evils. LGTM. |
Member
|
Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
When GDM launches a new session it will inherit the user's systemd
environment (but only unset variables). If
__NIXOS_SET_ENVIRONMENT_DONEis setin the user's systemd environment it will prevent the environment to be set
properly or updated (eg. after having done a system rebuild).
Gnome sessions exports their environment to systemd at startup. If something
is keeping the user's systemd process alive (eg. ssh) launching a new gnome
session after logging out will result in a broken PATH. Specifically the PATH
will be inherited from GDM and never reset.
We patch GDM to never inherit
__NIXOS_SET_ENVIRONMENT_DONEso new sessionswill always reset their base environment.
fixes #48255
For more info about the environment setup:
#45784
cc @jtojnar
The issue is also present in 18.09 so this fix should be backported.
Things done
Tested in a VM that logging into a new gnome session works properly when ssh is active after logging out once.